<template>
  <el-menu :default-active="activeMenu" class="el-menu-vertical-demo" @select="handleSelect" background-color="#f5f7fa" text-color="#333" active-text-color="#409EFF">
    <el-sub-menu index="1">
      <template #title>个人信息管理</template>
      <el-menu-item index="/personal/info">用户信息维护</el-menu-item>
      <el-menu-item index="/personal/password">密码维护</el-menu-item>
    </el-sub-menu>
    <el-sub-menu index="2">
      <template #title>成果信息管理</template>
      <el-menu-item index="/achievement/project">项目信息</el-menu-item>
      <el-menu-item index="/achievement/paper">论文信息</el-menu-item>
      <el-menu-item index="/achievement/book">著作信息</el-menu-item>
      <el-menu-item index="/achievement/award">获奖信息</el-menu-item>
      <el-menu-item index="/achievement/patent">专利信息</el-menu-item>
      <el-menu-item index="/achievement/material">教材信息</el-menu-item>
    </el-sub-menu>
    <el-sub-menu index="3">
      <template #title>指导学生信息</template>
      <el-menu-item index="/student/info">学生信息</el-menu-item>
      <el-menu-item index="/student/award">学生获奖</el-menu-item>
      <el-menu-item index="/student/thesis">学位论文</el-menu-item>
    </el-sub-menu>
    <el-sub-menu index="4">
      <template #title>管理员模块</template>
      <el-menu-item index="/admin/user">用户管理</el-menu-item>
      <el-menu-item index="/admin/teacher">教师管理</el-menu-item>
      <el-menu-item index="/admin/system">系统维护</el-menu-item>
    </el-sub-menu>
  </el-menu>
</template>
<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
const activeMenu = router.currentRoute.value.path;
const handleSelect = (index) => {
  router.push(index);
};
</script>
<style scoped>
.el-menu-vertical-demo {
  width: 220px;
  min-height: 100vh;
  border-right: 1px solid #eee;
}
</style> 